import { get, post, put, del } from '@/utils/request';
import api from './api';

// 设备详情
export async function apiPushSingle(data: object) {
  return post(api.apiPushSingle, data);
}

export async function deviceMaster(data: object) {
  return get(api.deviceMaster, data);
}

export async function deviceAdd(data: object) {
  return post(api.deviceAdd, data);
}

export async function deviceUpgradeSingle(data: object) {
  return post(api.deviceUpgradeSingle, data, {
    returnRes: true,
  });
}

export async function deviceUpdate(data: object) {
  return put(api.deviceUpdate, data);
}

export async function deviceDelete(data: string) {
  return del(api.deviceDelete + '/' + data, {});
}

export async function deviceOnlineState(data: object) {
  return get(api.deviceOnlineState, data);
}

export async function deviceRefreshConn(data: string) {
  return get(
    api.deviceRefreshConn + '/' + data,
    {},
    {
      returnRes: true,
    },
  );
}

export async function apiFileGetList(data: object) {
  return get(api.apiFileGetList, data);
}

// 生产详情
export async function weightGetList(data: object) {
  return get(api.weightGetList, data);
}

export async function apiWeightAdd(data: object) {
  return post(api.apiWeightAdd, data);
}

export async function apiWeightDelete(data: string) {
  return del(api.apiWeight + '/' + data, {});
}

export async function apiWeightUpdate(data: object) {
  return put(api.apiWeight, data);
}

export async function apiWeightExport(data: object) {
  return get(api.apiWeightExport, data);
}

export async function apiUserGetList(data: object) {
  return get(api.apiUserGetList, data);
}

export async function apiUserAdd(data: object) {
  return post(api.apiUserAdd, data);
}

export async function apiUserUpdate(data: object) {
  return put(api.apiUser, data);
}

export async function resetPassword(data: object) {
  return put(api.updatePassword, data, {
    returnRes: true,
  });
}

export async function apiUserDelete(data: string) {
  return del(api.apiUser + '/' + data, {});
}

export async function apiFileUpdate(data: object) {
  return put(api.apiFile, data);
}

export async function apiFileDelete(data: string) {
  return del(api.apiFile + '/' + data, {});
}

export async function apiFileDownload(data: object) {
  return get(api.apiFileDownload + '/' + data, {});
}

export async function apiLogDownload(data: object) {
  return get(api.apiLogDownload, data);
}

export async function apiLogGetList(data: object) {
  return get(api.apiLogGetList, data);
}

/*
 * 产品模块增删改
 * */
export async function apiProductGetList(data: object) {
  return get(api.apiProductGetList, data);
}

export async function apiProductDelete(data: string) {
  return del(api.apiProduct + '/' + data, {});
}

export async function apiProductAdd(data: object) {
  return post(api.apiProductAdd, data);
}

export async function apiProductUpdate(data: object) {
  return put(api.apiProduct, data);
}

/*
 * 产线模块增删改
 * */
export async function apiProductLineGetList(data: object) {
  return get(api.apiProductLineGetList, data);
}

export async function apiProductLineDelete(data: string) {
  return del(api.apiProductLine + '/' + data, {});
}

export async function apiProductLineAdd(data: object) {
  return post(api.apiProductLine, data);
}

export async function apiProductLineUpdate(data: object) {
  return put(api.apiProductLine, data);
}

/*
 * 班次模块增删改
 * */
export async function apiClassGetList(data: object) {
  return get(api.apiClassGetList, data);
}

export async function apiClassDelete(data: string) {
  return del(api.apiClass + '/' + data, {});
}

export async function apiClassAdd(data: object) {
  return post(api.apiClass, data);
}

export async function apiClassUpdate(data: object) {
  return put(api.apiClass, data);
}

/*
 * 排产模块增删改
 * */
export async function apiProduceScheduleGetList(data: object) {
  return get(api.apiProduceScheduleGetList, data);
}

export async function apiProduceScheduleDelete(data: string) {
  return del(api.apiProduceSchedule + '/' + data, {});
}

export async function apiProduceScheduleDetail(data: string) {
  return get(api.apiProduceSchedule + '/' + data, {});
}

export async function apiProduceScheduleAdd(data: object) {
  return post(api.apiProduceSchedule, data);
}

export async function apiProduceScheduleUpdate(data: object) {
  return put(api.apiProduceSchedule, data);
}

export async function apiProduceSchedulePush(data: object) {
  return put(api.apiProduceSchedulePush + '/' + data, {});
}

export async function apiProduceScheduleExport(data: object) {
  return get(api.apiProduceScheduleExport, data);
}

/*
 * 订单模块
 * */
export async function apiOrderGetList(data: object) {
  return get(api.apiOrderGetList, data);
}

export async function apiOrderGetChildrenList(data: object) {
  return get(api.apiOrderGetChildrenList, data);
}

export async function apiOrderDelete(data: string) {
  return del(api.apiOrder + '/' + data, {});
}

export async function apiOrderAdd(data: object) {
  return post(api.apiOrder, data);
}

export async function apiOrderUpdate(data: object) {
  return put(api.apiOrder, data);
}

/*
 * 采购模块
 * */
export async function apiPurchaseGetList(data: object) {
  return get(api.apiPurchaseGetList, data);
}

export async function apiPurchaseGetChildrenList(data: object) {
  return get(api.apiPurchaseGetChildrenList, data);
}

export async function apiPurchaseDelete(data: string) {
  return del(api.apiPurchase + '/' + data, {});
}

export async function apiPurchaseAdd(data: object) {
  return post(api.apiPurchase, data);
}

export async function apiPurchaseUpdate(data: object) {
  return put(api.apiPurchase, data);
}

/*
 * 库存模块增删改
 * */
export async function apiStockGetList(data: object) {
  return get(api.apiStockGetList, data);
}

export async function apiStockDelete(data: string) {
  return del(api.apiStock + '/' + data, {});
}

export async function apiStockAdd(data: object) {
  return post(api.apiStock, data);
}

export async function apiStockUpdate(data: object) {
  return put(api.apiStock, data);
}

/*
 * 库存模块增删改
 * */
export async function apiReceiptGetList(data: object) {
  return get(api.apiReceiptGetList, data);
}

export async function apiReceiptDelete(data: string) {
  return del(api.apiReceipt + '/' + data, {});
}

export async function apiReceiptAdd(data: object) {
  return post(api.apiReceipt, data);
}

export async function apiReceiptUpdate(data: object) {
  return put(api.apiReceipt, data);
}

/*
 * 销售模块增删改
 * */
export async function apiSaleGetList(data: object) {
  return get(api.apiSaleGetList, data);
}

export async function apiSaleDelete(data: string) {
  return del(api.apiSale + '/' + data, {});
}

export async function apiSaleAdd(data: object) {
  return post(api.apiSale, data);
}

export async function apiSaleUpdate(data: object) {
  return put(api.apiSale, data);
}

export async function apiSaleExport(data: object) {
  return get(api.apiSaleExport, data);
}

/*
 * 员工管理模块增删改
 * */
export async function apiEmployeeGetList(data: object) {
  return get(api.apiEmployeeGetList, data);
}

export async function apiEmployeeDelete(data: string) {
  return del(api.apiEmployee + '/' + data, {});
}

export async function apiEmployeeAdd(data: object) {
  return post(api.apiEmployee, data);
}

export async function apiEmployeeUpdate(data: object) {
  return put(api.apiEmployee, data);
}

/*
 * 客户管理模块增删改
 * */
export async function apiCustomerGetList(data: object) {
  return get(api.apiCustomerGetList, data);
}

export async function apiCustomerDelete(data: string) {
  return del(api.apiCustomer + '/' + data, {});
}

export async function apiCustomerAdd(data: object) {
  return post(api.apiCustomer, data);
}

export async function apiCustomerUpdate(data: object) {
  return put(api.apiCustomer, data);
}

/*
 * 收支详情
 * */
export async function apiBalanceDetailGetList(data: object) {
  return get(api.apiBalanceDetailGetList, data);
}

export async function apiBalanceDetailDelete(data: string) {
  return del(api.apiBalanceDetail + '/' + data, {});
}

export async function apiBalanceDetailAdd(data: object) {
  return post(api.apiBalanceDetail, data);
}

/*
 * 银行模块
 * */
export async function apiBankAccountGetBalance(data: string) {
  return get(api.apiBankAccountGetBalance + '/' + data, {});
}

export async function apiBankAccountGetList(data: object) {
  return get(api.apiBankAccountGetList, data);
}

export async function apiBankAccountDelete(data: string) {
  return del(api.apiBankAccount + '/' + data, {});
}

export async function apiBankAccountAdd(data: object) {
  return post(api.apiBankAccount, data);
}

/*
 * 采购商品清单
 * */
export async function apiPurchaseCommodityGetList(data: object) {
  return get(api.apiPurchaseCommodityGetList, data);
}

export async function apiPurchaseCommodityUpdate(data: object) {
  return put(api.apiPurchaseCommodity, data);
}

export async function apiPurchaseCommodityDelete(data: string) {
  return del(api.apiPurchaseCommodity + '/' + data, {});
}

export async function apiPurchaseCommodityAdd(data: object) {
  return post(api.apiPurchaseCommodity, data);
}

/*
 * 采购入库
 * */
export async function apiPurchaseReceiptGetList(data: object) {
  return get(api.apiPurchaseReceiptGetList, data);
}

export async function apiPurchaseReceiptUpdate(data: object) {
  return put(api.apiPurchaseReceipt, data);
}

export async function apiPurchaseReceiptDelete(data: string) {
  return del(api.apiPurchaseReceipt + '/' + data, {});
}

export async function apiPurchaseReceiptAdd(data: object) {
  return post(api.apiPurchaseReceipt, data);
}

/*
 * 采购付款
 * */

export async function apiPurchasePaymentDetailGetList(data: object) {
  return get(api.apiPurchasePaymentDetailGetList, data);
}

export async function apiPurchasePaymentDetailUpdate(data: object) {
  return put(api.apiPurchasePaymentDetail, data);
}

export async function apiPurchasePaymentDetailDelete(data: string) {
  return del(api.apiPurchasePaymentDetail + '/' + data, {});
}

export async function apiPurchasePaymentDetailAdd(data: object) {
  return post(api.apiPurchasePaymentDetail, data);
}

/*
 * 到票详情
 * */
export async function apiPurchaseReceivedInvoiceDetailGetList(data: object) {
  return get(api.apiPurchaseReceivedInvoiceDetailGetList, data);
}

export async function apiPurchaseReceivedInvoiceDetailUpdate(data: object) {
  return put(api.apiPurchaseReceivedInvoiceDetail, data);
}

export async function apiPurchaseReceivedInvoiceDetailDelete(data: string) {
  return del(api.apiPurchaseReceivedInvoiceDetail + '/' + data, {});
}

export async function apiPurchaseReceivedInvoiceDetailAdd(data: object) {
  return post(api.apiPurchaseReceivedInvoiceDetail, data);
}

/*
 * 供应商管理
 * */
export async function apiPurchaseSupplierGetList(data: object) {
  return get(api.apiPurchaseSupplierGetList, data);
}

export async function apiPurchaseSupplierDetailUpdate(data: object) {
  return put(api.apiPurchaseSupplierDetail, data);
}

export async function apiPurchaseSupplierDetailDelete(data: string) {
  return del(api.apiPurchaseSupplierDetail + '/' + data, {});
}

export async function apiPurchaseSupplierDetailAdd(data: object) {
  return post(api.apiPurchaseSupplierDetail, data);
}

/*
 * 曲线图接口
 * */
export async function apiStatistics(data: string) {
  return get(api.apiStatistics + '/' + data, {});
}
export async function apiStatisticsCard(data: string) {
  return get(api.apiStatisticsCard + '/' + data, {});
}

/*
 * 成品库存
 * */
export async function apiFinishedProductStockGetList(data: object) {
  return get(api.apiFinishedProductStockGetList, data);
}

export async function apiFinishedProductStockDetailUpdate(data: object) {
  return put(api.apiFinishedProductStockDetail, data);
}

export async function apiFinishedProductStockDetailDelete(data: string) {
  return del(api.apiFinishedProductStockDetail + '/' + data, {});
}

export async function apiFinishedProductStockDetailAdd(data: object) {
  return post(api.apiFinishedProductStockDetail, data);
}

/*
 * 边料库存
 * */
export async function apiOffcutStockList(data: object) {
  return get(api.apiOffcutStockList, data);
}

export async function apiOffcutStockDetailUpdate(data: object) {
  return put(api.apiOffcutStockDetail, data);
}

export async function apiOffcutStockDetailDelete(data: string) {
  return del(api.apiOffcutStockDetail + '/' + data, {});
}

export async function apiOffcutStockDetailAdd(data: object) {
  return post(api.apiOffcutStockDetail, data);
}
